package fjut.acm.coding.service.Impl;

import fjut.acm.coding.entity.JudgeResult;
import fjut.acm.coding.mapper.JudgeResultMapper;
import fjut.acm.coding.service.JudgeResultService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;


@Service
public class JudgeResultServiceImpl implements JudgeResultService {
    @Resource
    JudgeResultMapper judgeResultMapper;

    @Override
    public List<JudgeResult> selectJudgeResult(Integer judgeId) {
        Example example = new Example(JudgeResult.class);
        example.orderBy("time").asc();
        example.createCriteria().andEqualTo("judgeId", judgeId);
        return judgeResultMapper.selectByExample(example);
    }
}
